package cn.lil.servlet;

import cn.lil.model.Order;
import jakarta.servlet.*;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.*;

import java.io.IOException;
@WebServlet(name = "OrderLessonServlet", value = "/OrderLessonServlet")
public class OrderLessonServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Order order = (Order) request.getSession().getAttribute("order");
        int bid = Integer.parseInt(request.getParameter("bearingId"));
        order.lessen(bid);
        response.getWriter().print("ok");
    }
}
